package com.woniu.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;
import lombok.Data;

/**
 * 充电记录表
 * @TableName charging_record
 */
@TableName(value ="charging_record")
@Data
public class ChargingRecord implements Serializable {
    /**
     * 主键
     */
    @TableId(type = IdType.AUTO)
    private Long id;

    /**
     * 订单号
     */
    private String orderNumber;

    /**
     * 客户id
     */
    private Long customerId;

    /**
     * 充电电量
     */
    private BigDecimal chargedEnergy;

    /**
     * 充电时间
     */
    private Date chargingTime;

    /**
     * 充电时长
     */
    private Integer chargingDuration;

    /**
     * 金额
     */
    private BigDecimal amount;

    /**
     * 支付方式
     */
    private String paymentMethod;

    /**
     * 交易类型
     */
    private String transactionType;

    /**
     * 充电类别
     */
    private String chargingCategory;

    /**
     * 充电桩id
     */
    private Long chargerId;

    /**
     * 交易状态
     */
    private String transactionStatus;

    @TableField(exist = false)
    private static final long serialVersionUID = 1L;

    @Override
    public boolean equals(Object that) {
        if (this == that) {
            return true;
        }
        if (that == null) {
            return false;
        }
        if (getClass() != that.getClass()) {
            return false;
        }
        ChargingRecord other = (ChargingRecord) that;
        return (this.getId() == null ? other.getId() == null : this.getId().equals(other.getId()))
            && (this.getOrderNumber() == null ? other.getOrderNumber() == null : this.getOrderNumber().equals(other.getOrderNumber()))
            && (this.getCustomerId() == null ? other.getCustomerId() == null : this.getCustomerId().equals(other.getCustomerId()))
            && (this.getChargedEnergy() == null ? other.getChargedEnergy() == null : this.getChargedEnergy().equals(other.getChargedEnergy()))
            && (this.getChargingTime() == null ? other.getChargingTime() == null : this.getChargingTime().equals(other.getChargingTime()))
            && (this.getChargingDuration() == null ? other.getChargingDuration() == null : this.getChargingDuration().equals(other.getChargingDuration()))
            && (this.getAmount() == null ? other.getAmount() == null : this.getAmount().equals(other.getAmount()))
            && (this.getPaymentMethod() == null ? other.getPaymentMethod() == null : this.getPaymentMethod().equals(other.getPaymentMethod()))
            && (this.getTransactionType() == null ? other.getTransactionType() == null : this.getTransactionType().equals(other.getTransactionType()))
            && (this.getChargingCategory() == null ? other.getChargingCategory() == null : this.getChargingCategory().equals(other.getChargingCategory()))
            && (this.getChargerId() == null ? other.getChargerId() == null : this.getChargerId().equals(other.getChargerId()))
            && (this.getTransactionStatus() == null ? other.getTransactionStatus() == null : this.getTransactionStatus().equals(other.getTransactionStatus()));
    }

    @Override
    public int hashCode() {
        final int prime = 31;
        int result = 1;
        result = prime * result + ((getId() == null) ? 0 : getId().hashCode());
        result = prime * result + ((getOrderNumber() == null) ? 0 : getOrderNumber().hashCode());
        result = prime * result + ((getCustomerId() == null) ? 0 : getCustomerId().hashCode());
        result = prime * result + ((getChargedEnergy() == null) ? 0 : getChargedEnergy().hashCode());
        result = prime * result + ((getChargingTime() == null) ? 0 : getChargingTime().hashCode());
        result = prime * result + ((getChargingDuration() == null) ? 0 : getChargingDuration().hashCode());
        result = prime * result + ((getAmount() == null) ? 0 : getAmount().hashCode());
        result = prime * result + ((getPaymentMethod() == null) ? 0 : getPaymentMethod().hashCode());
        result = prime * result + ((getTransactionType() == null) ? 0 : getTransactionType().hashCode());
        result = prime * result + ((getChargingCategory() == null) ? 0 : getChargingCategory().hashCode());
        result = prime * result + ((getChargerId() == null) ? 0 : getChargerId().hashCode());
        result = prime * result + ((getTransactionStatus() == null) ? 0 : getTransactionStatus().hashCode());
        return result;
    }

    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append(getClass().getSimpleName());
        sb.append(" [");
        sb.append("Hash = ").append(hashCode());
        sb.append(", id=").append(id);
        sb.append(", orderNumber=").append(orderNumber);
        sb.append(", customerId=").append(customerId);
        sb.append(", chargedEnergy=").append(chargedEnergy);
        sb.append(", chargingTime=").append(chargingTime);
        sb.append(", chargingDuration=").append(chargingDuration);
        sb.append(", amount=").append(amount);
        sb.append(", paymentMethod=").append(paymentMethod);
        sb.append(", transactionType=").append(transactionType);
        sb.append(", chargingCategory=").append(chargingCategory);
        sb.append(", chargerId=").append(chargerId);
        sb.append(", transactionStatus=").append(transactionStatus);
        sb.append(", serialVersionUID=").append(serialVersionUID);
        sb.append("]");
        return sb.toString();
    }
}